<?php

use app\models\ArcKeyword;
use app\models\AsrKeyword;
use app\models\AsrSeriousness;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\ArcKeyword */

$asr_name = new AsrSeriousness();
$data = $asr_name->find()->all();
$asr_key = new ArcKeyword();
$model = $asr_key->find()->all();

$this->title = '选择';
$this->params['breadcrumbs'][] = ['label' => 'Arc Keywords', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;

?>
<div class="arc-keyword-view">

    <h4>选择严重程度</h4>

    <?php $form = ActiveForm::begin(); ?>
    <tr>
            <select id="numbers" name="numUnit" class="form-control">
                <option value="0" selected>请选择(默认为全部关键字)</option>
                <?php foreach ($result as $value) :?>
                <option value="<?= $value['id']?>"><?= $value['names']?></option>
                <?php endforeach;?>
            </select>
    </tr>
    <div id="content" style="margin-top:20px;">
        <table class="table table-bordered table-hover table-striped">
            <tr class="info"><th></th><th></th><th style="text-align:center;">关键字</th><th></th><th></th><th></th></tr>
            <tbody>
                <tr>
                <?php foreach($keyword as $key=>$val):?>
                    <?php if($key%6==0):?>
                        <tr class="info">

                        </tr>
                    <?php endif;?>
                    <td>
                        <div class="checkbox">
                            <label >
                                <input type="checkbox"> <?=$val['name']?>
                            </label>
                        </div>
                    </td>
                <?php endforeach;?>
                </tr>
            </tbody>
        </table>
    </div>
    <?php ActiveForm::end(); ?>

</div>

<script>
        $(function () {
            $(document).on("change",'#numbers',function(){
                console.log($(this).val());
                if($(this).val()==0){
                    $('#content').html('');
                    $("#content").html('<table class="table table-bordered table-hover table-striped">

                        </table>');
                }else if($(this).val()){

                }
            });

        });
</script>  
